<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/production/production/Production_PMCPlan.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/production/production/Production_PMCPlan.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'PmcId',
                footer: "Foots",
                cnName: 'PMC计划',
                name: 'production/Production_PMCPlan',
                url: "/Production_PMCPlan/",
                sortName: "OrgCode"
            });
            const editFormFields = ref({"FNumber":""});
            const editFormOptions = ref([[{"title":"产品编号","field":"FNumber","type":"text"}]]);
            const searchFormFields = ref({"FStatus":"","OrgCode":"","FNumber":"","Ver":""});
            const searchFormOptions = ref([[{"dataKey":"Org","data":[],"title":"组织","field":"OrgCode","type":"select"},{"dataKey":"enable","data":[],"title":"是否启用","field":"FStatus","type":"select"}],[{"dataKey":"PMCPlanVer","data":[],"title":"版本号","field":"Ver","type":"like"},{"title":"产品编号","field":"FNumber","type":"like"}]]);
            const columns = ref([{field:'PmcId',title:'ID',type:'long',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'FStatus',title:'是否启用',type:'int',bind:{ key:'enable',data:[]},width:80,readonly:true,require:true,align:'left',sort:true},
                       {field:'OrgCode',title:'组织',type:'string',bind:{ key:'Org',data:[]},width:110,hidden:true,readonly:true,align:'left'},
                       {field:'FNumber',title:'产品编号',type:'string',sort:true,link:true,width:220,align:'left'},
                       {field:'StartDate',title:'计划开始日期',type:'datetime',width:150,hidden:true,readonly:true,align:'left',sort:true},
                       {field:'Ver',title:'版本号',type:'string',bind:{ key:'PMCPlanVer',data:[]},sort:true,width:150,readonly:true,align:'left'},
                       {field:'BeginInvQty',title:'期初库存',type:'int',width:110,readonly:true,align:'left'},
                       {field:'InactiveInvQty',title:'呆滞库存',type:'int',width:110,readonly:true,align:'left'},
                       {field:'YAQty',title:'需求合计',type:'int',width:110,readonly:true,align:'left'},
                       {field:'YMQty1',title:'1月',type:'int',width:110,readonly:true,align:'left'},
                       {field:'YMQty2',title:'2月',type:'int',width:110,readonly:true,align:'left'},
                       {field:'YMQty3',title:'3月',type:'int',width:110,readonly:true,align:'left'},
                       {field:'YMQty4',title:'4月',type:'int',width:110,readonly:true,align:'left'},
                       {field:'CreateDate',title:'创建日期',type:'datetime',width:150,readonly:true,require:true,align:'left',sort:true},
                       {field:'Creator',title:'创建人',type:'string',width:130,readonly:true,require:true,align:'left'}]);
            const detail = ref({
                cnName: "PMC计划列表",
                table: "Production_PMCPlanList",
                columns: [{field:'PmcDetialId',title:'ID',type:'long',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'PmcId',title:'PID',type:'long',width:110,hidden:true,require:true,align:'left'},
                       {field:'FType',title:'是否自动',type:'string',width:110,align:'left',sort:true},
                       {field:'FDate',title:'日期',type:'datetime',width:110,align:'left',sort:true},
                       {field:'FQty',title:'数量',type:'decimal',width:110,edit:{type:'number'},align:'left'}],
                sortName: "FDate",
                key: "PmcDetialId"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
